Optimal. Leaf size=173 \[ 2 b^2 d^2 n^2 x+\frac {1}{2} b^2 d e n^2 x^2+\frac {2}{27} b^2 e^2 n^2 x^3+\frac {b^2 d^3 n^2 \log ^2(x)}{3 e}-2 b d^2 n x \left (a+b \log \left (c x^n\right )\right )-b d e n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {2}{9} b e^2 n x^3 \left (a+b \log \left (c x^n\right )\right )-\frac {2 b d^3 n \log (x) \left (a+b \log \left (c x^n\right )\right )}{3 e}+\frac {(d+e x)^3 \left (a+b \log \left (c x^n\right )\right )^2}{3 e} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 173, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2356, 45, 2372,
2338} \begin {gather*} -\frac {2 b d^3 n \log (x) \left (a+b \log \left (c x^n\right )\right )}{3 e}-2 b d^2 n x \left (a+b \log \left (c x^n\right )\right )+\frac {(d+e x)^3 \left (a+b \log \left (c x^n\right )\right )^2}{3 e}-b d e n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {2}{9} b e^2 n x^3 \left (a+b \log \left (c x^n\right )\right )+\frac {b^2 d^3 n^2 \log ^2(x)}{3 e}+2 b^2 d^2 n^2 x+\frac {1}{2} b^2 d e n^2 x^2+\frac {2}{27} b^2 e^2 n^2 x^3 \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 2338
Rule 2356
Rule 2372
Rubi steps
\begin {align*} \int (d+e x)^2 \left (a+b \log \left (c x^n\right )\right )^2 \, dx &=\frac {(d+e x)^3 \left (a+b \log \left (c x^n\right )\right )^2}{3 e}-\frac {(2 b n) \int \frac {(d+e x)^3 \left (a+b \log \left (c x^n\right )\right )}{x} \, dx}{3 e}\\ &=-\frac {b n \left (18 d^2 e x+9 d e^2 x^2+2 e^3 x^3+6 d^3 \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )}{9 e}+\frac {(d+e x)^3 \left (a+b \log \left (c x^n\right )\right )^2}{3 e}+\frac {\left (2 b^2 n^2\right ) \int \left (\frac {1}{6} e \left (18 d^2+9 d e x+2 e^2 x^2\right )+\frac {d^3 \log (x)}{x}\right ) \, dx}{3 e}\\ &=-\frac {b n \left (18 d^2 e x+9 d e^2 x^2+2 e^3 x^3+6 d^3 \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )}{9 e}+\frac {(d+e x)^3 \left (a+b \log \left (c x^n\right )\right )^2}{3 e}+\frac {1}{9} \left (b^2 n^2\right ) \int \left (18 d^2+9 d e x+2 e^2 x^2\right ) \, dx+\frac {\left (2 b^2 d^3 n^2\right ) \int \frac {\log (x)}{x} \, dx}{3 e}\\ &=2 b^2 d^2 n^2 x+\frac {1}{2} b^2 d e n^2 x^2+\frac {2}{27} b^2 e^2 n^2 x^3+\frac {b^2 d^3 n^2 \log ^2(x)}{3 e}-\frac {b n \left (18 d^2 e x+9 d e^2 x^2+2 e^3 x^3+6 d^3 \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )}{9 e}+\frac {(d+e x)^3 \left (a+b \log \left (c x^n\right )\right )^2}{3 e}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 135, normalized size = 0.78 \begin {gather*} \frac {2}{27} b e^2 n x^3 \left (-3 a+b n-3 b \log \left (c x^n\right )\right )+\frac {1}{2} b d e n x^2 \left (-2 a+b n-2 b \log \left (c x^n\right )\right )+d^2 x \left (a+b \log \left (c x^n\right )\right )^2+d e x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{3} e^2 x^3 \left (a+b \log \left (c x^n\right )\right )^2-2 b d^2 n x \left (a-b n+b \log \left (c x^n\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 0.32, size = 2565, normalized size = 14.83
method | result | size |
risch | \(\text {Expression too large to display}\) | \(2565\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 235, normalized size = 1.36 \begin {gather*} \frac {1}{3} \, b^{2} x^{3} e^{2} \log \left (c x^{n}\right )^{2} + b^{2} d x^{2} e \log \left (c x^{n}\right )^{2} - \frac {2}{9} \, a b n x^{3} e^{2} - a b d n x^{2} e + \frac {2}{3} \, a b x^{3} e^{2} \log \left (c x^{n}\right ) + 2 \, a b d x^{2} e \log \left (c x^{n}\right ) + b^{2} d^{2} x \log \left (c x^{n}\right )^{2} - 2 \, a b d^{2} n x + \frac {1}{3} \, a^{2} x^{3} e^{2} + a^{2} d x^{2} e + 2 \, a b d^{2} x \log \left (c x^{n}\right ) + 2 \, {\left (n^{2} x - n x \log \left (c x^{n}\right )\right )} b^{2} d^{2} + a^{2} d^{2} x + \frac {1}{2} \, {\left (n^{2} x^{2} - 2 \, n x^{2} \log \left (c x^{n}\right )\right )} b^{2} d e + \frac {2}{27} \, {\left (n^{2} x^{3} - 3 \, n x^{3} \log \left (c x^{n}\right )\right )} b^{2} e^{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 331 vs.
\(2 (159) = 318\).
time = 0.38, size = 331, normalized size = 1.91 \begin {gather*} \frac {1}{27} \, {\left (2 \, b^{2} n^{2} - 6 \, a b n + 9 \, a^{2}\right )} x^{3} e^{2} + \frac {1}{2} \, {\left (b^{2} d n^{2} - 2 \, a b d n + 2 \, a^{2} d\right )} x^{2} e + \frac {1}{3} \, {\left (b^{2} x^{3} e^{2} + 3 \, b^{2} d x^{2} e + 3 \, b^{2} d^{2} x\right )} \log \left (c\right )^{2} + \frac {1}{3} \, {\left (b^{2} n^{2} x^{3} e^{2} + 3 \, b^{2} d n^{2} x^{2} e + 3 \, b^{2} d^{2} n^{2} x\right )} \log \left (x\right )^{2} + {\left (2 \, b^{2} d^{2} n^{2} - 2 \, a b d^{2} n + a^{2} d^{2}\right )} x - \frac {1}{9} \, {\left (2 \, {\left (b^{2} n - 3 \, a b\right )} x^{3} e^{2} + 9 \, {\left (b^{2} d n - 2 \, a b d\right )} x^{2} e + 18 \, {\left (b^{2} d^{2} n - a b d^{2}\right )} x\right )} \log \left (c\right ) - \frac {1}{9} \, {\left (2 \, {\left (b^{2} n^{2} - 3 \, a b n\right )} x^{3} e^{2} + 9 \, {\left (b^{2} d n^{2} - 2 \, a b d n\right )} x^{2} e + 18 \, {\left (b^{2} d^{2} n^{2} - a b d^{2} n\right )} x - 6 \, {\left (b^{2} n x^{3} e^{2} + 3 \, b^{2} d n x^{2} e + 3 \, b^{2} d^{2} n x\right )} \log \left (c\right )\right )} \log \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.31, size = 286, normalized size = 1.65 \begin {gather*} a^{2} d^{2} x + a^{2} d e x^{2} + \frac {a^{2} e^{2} x^{3}}{3} - 2 a b d^{2} n x + 2 a b d^{2} x \log {\left (c x^{n} \right )} - a b d e n x^{2} + 2 a b d e x^{2} \log {\left (c x^{n} \right )} - \frac {2 a b e^{2} n x^{3}}{9} + \frac {2 a b e^{2} x^{3} \log {\left (c x^{n} \right )}}{3} + 2 b^{2} d^{2} n^{2} x - 2 b^{2} d^{2} n x \log {\left (c x^{n} \right )} + b^{2} d^{2} x \log {\left (c x^{n} \right )}^{2} + \frac {b^{2} d e n^{2} x^{2}}{2} - b^{2} d e n x^{2} \log {\left (c x^{n} \right )} + b^{2} d e x^{2} \log {\left (c x^{n} \right )}^{2} + \frac {2 b^{2} e^{2} n^{2} x^{3}}{27} - \frac {2 b^{2} e^{2} n x^{3} \log {\left (c x^{n} \right )}}{9} + \frac {b^{2} e^{2} x^{3} \log {\left (c x^{n} \right )}^{2}}{3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 385 vs.
\(2 (159) = 318\).
time = 2.84, size = 385, normalized size = 2.23 \begin {gather*} \frac {1}{3} \, b^{2} n^{2} x^{3} e^{2} \log \left (x\right )^{2} + b^{2} d n^{2} x^{2} e \log \left (x\right )^{2} - \frac {2}{9} \, b^{2} n^{2} x^{3} e^{2} \log \left (x\right ) - b^{2} d n^{2} x^{2} e \log \left (x\right ) + \frac {2}{3} \, b^{2} n x^{3} e^{2} \log \left (c\right ) \log \left (x\right ) + 2 \, b^{2} d n x^{2} e \log \left (c\right ) \log \left (x\right ) + b^{2} d^{2} n^{2} x \log \left (x\right )^{2} + \frac {2}{27} \, b^{2} n^{2} x^{3} e^{2} + \frac {1}{2} \, b^{2} d n^{2} x^{2} e - \frac {2}{9} \, b^{2} n x^{3} e^{2} \log \left (c\right ) - b^{2} d n x^{2} e \log \left (c\right ) + \frac {1}{3} \, b^{2} x^{3} e^{2} \log \left (c\right )^{2} + b^{2} d x^{2} e \log \left (c\right )^{2} - 2 \, b^{2} d^{2} n^{2} x \log \left (x\right ) + \frac {2}{3} \, a b n x^{3} e^{2} \log \left (x\right ) + 2 \, a b d n x^{2} e \log \left (x\right ) + 2 \, b^{2} d^{2} n x \log \left (c\right ) \log \left (x\right ) + 2 \, b^{2} d^{2} n^{2} x - \frac {2}{9} \, a b n x^{3} e^{2} - a b d n x^{2} e - 2 \, b^{2} d^{2} n x \log \left (c\right ) + \frac {2}{3} \, a b x^{3} e^{2} \log \left (c\right ) + 2 \, a b d x^{2} e \log \left (c\right ) + b^{2} d^{2} x \log \left (c\right )^{2} + 2 \, a b d^{2} n x \log \left (x\right ) - 2 \, a b d^{2} n x + \frac {1}{3} \, a^{2} x^{3} e^{2} + a^{2} d x^{2} e + 2 \, a b d^{2} x \log \left (c\right ) + a^{2} d^{2} x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.49, size = 166, normalized size = 0.96 \begin {gather*} {\ln \left (c\,x^n\right )}^2\,\left (b^2\,d^2\,x+b^2\,d\,e\,x^2+\frac {b^2\,e^2\,x^3}{3}\right )+\ln \left (c\,x^n\right )\,\left (2\,b\,\left (a-b\,n\right )\,d^2\,x+b\,\left (2\,a-b\,n\right )\,d\,e\,x^2+\frac {2\,b\,\left (3\,a-b\,n\right )\,e^2\,x^3}{9}\right )+d^2\,x\,\left (a^2-2\,a\,b\,n+2\,b^2\,n^2\right )+\frac {e^2\,x^3\,\left (9\,a^2-6\,a\,b\,n+2\,b^2\,n^2\right )}{27}+\frac {d\,e\,x^2\,\left (2\,a^2-2\,a\,b\,n+b^2\,n^2\right )}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________